package com.example.logdemo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@Slf4j
public class LogDemoApplication {
    private static int num = 10;

    public static void main(String[] args) throws InterruptedException {
        SpringApplication.run(LogDemoApplication.class, args);
        User u = new User();
        u.setName("小明");
        u.setAge(11);
        while (true) if (num > 0) {
            log.debug("第{}次运行", num);

            log.info("测试info");
            log.info("测试对象：{}", u);
            log.error("测试error");
            log.error("测试对象：{}", u);

            num--;
            Thread.sleep(1000);
        }
    }

}
